package br.edu.ufcg.sig.server.persistence;

import java.util.List;

import org.postgis.Geometry;
import org.postgis.Polygon;

import br.edu.ufcg.sig.server.beans.Delict;
import br.edu.ufcg.sig.server.exceptions.DelictNotFoundException;
import br.edu.ufcg.sig.server.persistence.dao.DelictDAO;
import br.edu.ufcg.sig.server.persistence.dao.DelictJdbcDAO;


public class PersistenceManager {
	
	private DelictDAO delictDAO;
	
	public PersistenceManager(){
//		this.delictDAO = new DelictHibernateDAO();
		this.delictDAO = new DelictJdbcDAO();
	}
	
	public void saveDelict(Delict delict){
		delictDAO.saveDelict(delict);
	}
	
	public void removeDelict(Delict delict) throws DelictNotFoundException{
		delictDAO.removeDelict(delict);
	}
	
	public Delict getDelict(long id) throws DelictNotFoundException{
		return delictDAO.getDelict(id);
	}
	
	public List<Delict> getAllDelicts(){
		return delictDAO.getAllDelicts();
	}
	
	public List<String> getHotZones(){
		return delictDAO.getHotZones();
	}
	
	public int countCrimesByType(Geometry area, String type){
//		return delictDAO.countCrimesByType(area, type);
		return 0;
	}
	
	public void updateDelict(Delict delict) throws DelictNotFoundException{
		delictDAO.updateDelict(delict);
	}
	
	public void removeAllDelicts(){
		delictDAO.removeAllDelicts();
	}

}
